package com.happe.foodeasy.manage.controller.linkimg;

import com.happe.foodeasy.manage.service.PositionService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource;

/**
 * This class is used to help linkImage interface to skip url link
 * Created by Administrator on 2016/8/11.
 */
@Controller
@RequestMapping("/linkImageSkip")
public class LinkImageSkipViewController {
    private static final String ALL_POSITION_LIST = "allPosition";

    @Resource
    private PositionService positionService;

    @SuppressWarnings("all")
    @RequestMapping("/linkImageManage.do")
    public ModelAndView skipLinkImageManage() {
        return new ModelAndView("forward:/positionImage/enterLinkImageManage.do?position=1&status=1");
    }

    @RequestMapping("/addLinkImage.do")
    public ModelAndView skipAddLinkImage(){
        ModelAndView modelAndView = new ModelAndView("linkImg/addLinkImage");
        modelAndView.addObject(ALL_POSITION_LIST, positionService.retrieveAllPosition());
        return modelAndView;
    }

    @SuppressWarnings("all")
    public void setPositionService(PositionService positionService) {
        this.positionService = positionService;
    }
}
